﻿<?php //Seyret Component v.0.3//
/**
* @package Seyret
* @version 0.3
* @copyright Copyright (C) 2008 Mustafa DINDAR. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Seyret Video Component is a free software.
* See seyrettos.html for license notices and details.
*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

$document = & JFactory::getDocument();



$user =& JFactory::getUser();
$userid=$user->id;


echo $this->toolbar;
echo $this->modtoolbar;

$channel=$this->channeldata;



?>


<script  type="text/javascript">

jQuery(document).ready(function(){


	
	jQuery.seyrettools.createmultibox("flash", "uploadchannelimage", null , null , null , "sidt=<?php echo $this->sidt;?>&amp;task=uploadchannelimage&amp;uptype=image&amp;siteurl=<?php echo JURI :: root(); ?>&amp;uid=<?php echo $userid;?>&amp;inputfield=channelimage&amp;boxname=channelimage&amp;key=<?php echo  $this->reglocal->seyretswfprokey;?>");
	jQuery.seyrettools.createmultibox("flash", "uploadchannelbanner", null , null , null , "sidt=<?php echo $this->sidt;?>&amp;task=uploadchannelbanner&amp;uptype=image&amp;siteurl=<?php echo JURI :: root(); ?>&amp;uid=<?php echo $userid;?>&amp;inputfield=channelbanner&amp;boxname=channelbanner&amp;key=<?php echo  $this->reglocal->seyretswfprokey;?>");

	
});

	

function selectfilefla(boxname, inputbox, fileurl){
	

	document.getElementById(inputbox).value = fileurl;
		if (boxname == "channelimage") {
			jQuery('#channelimgdiveditpage').html('<img id ="channelimgeditpage" name ="channelimgeditpage" class ="channelimgeditpage" src = "' + fileurl +'"alt = ""/>');
		} else if (boxname == "channelbanner") {
			jQuery('#channelbannerdiveditpage').html('<img id ="channelbannereditpage" name ="channelbannereditpage" class ="channelbannereditpage" src = "' + fileurl +'" alt=""/>');
		}
		

	

	jQuery("#cboxClose").click();
}


function cancelfilefla(boxname){
	jQuery("#cboxClose").click();
}


function validate_form(thisform)
{
	with (thisform)
	{
		 
		if (jQuery("#channeltitle").attr('value')=="") {
			jQuery("#channeltitle").removeClass('seyretinputbox').addClass('redseyretinputbox');
			var returnvalue="false";
		} else {
			jQuery("#channeltitle").removeClass('redseyretinputbox').addClass('seyretinputbox');
		}
		
		if (jQuery("#channelimage").attr('value')=="") {
			jQuery("#channelimage").removeClass('seyretinputbox').addClass('redseyretinputbox');
			var returnvalue="false";
		} else {
			jQuery("#channelimage").removeClass('redseyretinputbox').addClass('seyretinputbox');
		}
		
		if (jQuery("#channeldesc").attr('value')=="") {
			jQuery("#channeldesc").removeClass('seyretinputbox').addClass('redseyretinputbox');
			var returnvalue="false";
		} else {
			jQuery("#channeldesc").removeClass('redseyretinputbox').addClass('seyretinputbox');
		}	



		
	}
	
	
	if (returnvalue=="false") {
		return false;
	}
}

</script>

<form id="channelform" name="channelform" action="index.php?option=com_seyret&amp;view=channel&amp;task=savechannel" method="post" onsubmit="return validate_form(this)">
	
	
<div>

	<div id="editchannelinfo">
			<p><?php echo JText::_('Add Channel Info'); ?></p>
	</div>

	<div class="automargin" id="channelimgdiveditpage">
		<?php 
		if ($channel->channelimage!="") {
		?>
			<img class="channelimgeditpage" id="channelimgeditpage" name="channelimgeditpage"  src="<?php echo $channel->channelimage; ?>" alt="<?php echo $channel->channeltitle; ?>"/> 
		
		<?php 
		}
		
		?>
	</div>
	
	<div class="automargin" id="channelbannerdiveditpage">
		<?php 
		if ($channel->channelbanner!="") {
		?>
			<img class="channelbannereditpage" id="channelbannereditpage" name="channelbannereditpage"  src="<?php echo $channel->channelbanner; ?>" alt="<?php echo $channel->channeltitle; ?>"/> 
		
		<?php 
		}
		
		?>
	</div>
	
	
	
	
	
	
	<div id="editchanneldetails">
			<div class="editchannellabel"><?php echo JText::_('Channel Title');?></div>
			<div class="editchannellabelinput"><input type="text" name="channeltitle" id="channeltitle" class="editchannelinputbox seyretinputbox" value="<?php echo $channel->channeltitle; ?>" /></div>
			<div style="clear:both;"></div>
			

			<!-- upload channel image box  *************** START ************* -->
			<div class="editchannellabel"><?php echo JText::_('Channel Image');?></div>
			<div class="editchannellabelinput"><input type="text" name="channelimage" id="channelimage" class="editchannelinputbox seyretinputbox" readonly="readonly"  value="<?php echo $channel->channelimage; ?>" />&nbsp;<a href="<?php echo JURI :: root()."components/com_seyret/includes/tools/swf/imageuploader.swf"; ?>?width=480&amp;height=200" rel="uploadchannelimage" class="uploadimage" title="<?php echo JText::_('Upload Channel Image'); ?>"><?php echo JText::_('Upload Image'); ?></a> </div>
			<div style="clear:both;"></div>

			<!-- upload channel image box *************** END ************* -->	


			<!-- upload channel banner box  *************** START ************* -->
			<div class="editchannellabel"><?php echo JText::_('Channel Banner');?></div>
			<div class="editchannellabelinput"><input type="text" name="channelbanner" id="channelbanner" class="editchannelinputbox seyretinputbox" readonly="readonly"  value="<?php echo $channel->channelbanner; ?>" />&nbsp;<a href="<?php echo JURI :: root()."components/com_seyret/includes/tools/swf/imageuploader.swf"; ?>?width=480&amp;height=200" rel="uploadchannelbanner" class="uploadimage" title="<?php echo JText::_('Upload Channel BAnner'); ?>"><?php echo JText::_('Upload Banner'); ?></a> </div>
			<div style="clear:both;"></div>

			<!-- upload channel banner box *************** END ************* -->	

			
			<div class="editchannellabel"><?php echo JText::_('Channel Description');?></div>
			<div class="editchannellabelinput"><textarea  name="channeldesc" id="channeldesc"  class="editchannelinputbox seyretinputbox" rows="4" cols="20"><?php echo $channel->channeldesc; ?></textarea></div>
			<div style="clear:both;"></div>
			

			<div class="editchannellabel"><?php echo JText::_('Open to membership');?></div>
			<div class="editchannellabelinput"><?php echo $channel->opentomembershipselect; ?></div>
			<div style="clear:both;"></div>	

			<div class="editchannellabel"><?php echo JText::_('Open to public');?></div>
			<div class="editchannellabelinput"><?php echo $channel->opentopublicselect; ?></div>
			<div style="clear:both;"></div>	

			<input type="hidden" name="id" value="<?php echo $channel->id;?>" />
			<input type="submit" value="Submit" id="submit" class="seyretbuttonnarrow" />			
			
		</div>	
			
	
	
</div>

</form>	